package com.woniuxy.controller;

import com.woniuxy.entity.ResponseEntity;
import com.woniuxy.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName LoginController
 * @Description TODO
 * @Author LI.hh
 * @Date 2022/9/5 20:17
 * @Version 1.0
 */
@RestController
@CrossOrigin
public class LoginController {
    @Autowired
    LoginService loginService;
    @GetMapping("/login")
    public ResponseEntity login(String username,String password){
        return loginService.login(username,password);
    }
    @RequestMapping("/401")
    public ResponseEntity response401(){
        return ResponseEntity.AUTHFAILED;
    }
}
